/*
 * ActivationFunction.cpp
 *
 *  Created on: Sep 6, 2013
 *      Author: filipe
 */
#include <cstdio>
#include <cmath>
#include "Activation.h"


ActivationFunction::ActivationFunction()
{
}


ActivationFunction::~ActivationFunction()
{
}


LinearActivationFunction::LinearActivationFunction(double slope) : ActivationFunction()
{
	_slope = slope;
}


LinearActivationFunction::~LinearActivationFunction()
{
}


double
LinearActivationFunction::Evaluate(double value)
{
	return (_slope * value);
}


SignalActivationFunction::SignalActivationFunction(double smoothness) : ActivationFunction()
{
	_smoothness = smoothness;
}


SignalActivationFunction::~SignalActivationFunction()
{
}


double
SignalActivationFunction::Evaluate(double value)
{
	return (1.0 / (1.0 + exp(-value / _smoothness)));
}


StepActivationFunction::StepActivationFunction()
{
}


StepActivationFunction::~StepActivationFunction()
{
}


double
StepActivationFunction::Evaluate(double value)
{
	if (value > 0)
		return 1.0;
	else
		return -1.0;
}
